package com.moon.exception;

import cn.dev33.satoken.exception.NotLoginException;
import cn.dev33.satoken.exception.NotPermissionException;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * @author thy
 * @description：todo
 * @date 2024/9/10 14:40
 */
@RestControllerAdvice
@Slf4j
public class GlobeException {

    @ExceptionHandler(NotLoginException.class)
    public String handNotLoginException(Exception e) {
        log.error("你没登陆", e);
        return "你没登陆";
    }

    @ExceptionHandler(NotPermissionException.class)
    public String handNotPermissionException(Exception e) {
        log.error("你没权限", e);
        return "你没权限";
    }


}
